const express = require('express');
var server = express();
//cookie
const cookieparser = require('cookie-parser');
server.use(cookieparser());

server.use('/aaa/a.html',function(req,res){
    //读取cookie 装完cookie-parser后有这个属性
    console.log(req.cookies,'read');
    //发送cookie
    res.cookie('user','yuonly',{path:'/aaa',maxAge:30*24*3600*1000});
    res.send('ok');
})

// http://localhost:8080/aaa/a.html

server.listen(8080);
